package com.liy.cloud.common.feign.api;

import com.liy.cloud.common.feign.fallback.SysFeignClientFallbackFactory;
import com.das.framework.common.extvo.ResultVO;
import com.das.framework.common.vo.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * 系统模块相关接口定义在该类
 */
@Component
@FeignClient(name = "sys", fallbackFactory = SysFeignClientFallbackFactory.class)
public interface SysFeignClient {


    /**
     * 根据条件查询字典列表
     *
     * @param vo 按typecode查询状态可用的字典项
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/dict/item/enablelist/{pageSize}/{pageNo}", method = RequestMethod.GET)
    public PageVO getDictItemEnableList(
            @RequestParam("get") Object vo,
            @PathVariable("pageSize") Integer pageSize, @PathVariable("pageNo") Integer pageNo);

    /**
     * 根据条件查询字典列表
     *
     * @param vo 根据TypeCode查找子类项
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/dict/item/select/typecode/{pageSize}/{pageNo}", method = RequestMethod.GET)
    public PageVO getDictItemSelectTypecode(
            @RequestParam("get") Object vo,
            @PathVariable("pageSize") Integer pageSize, @PathVariable("pageNo") Integer pageNo);

    /**
     * 根据条件查询字典列表
     *
     * @param vo
     * @param pageSize
     * @param pageNo
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/dict/item/query/{pageSize}/{pageNo}", method = RequestMethod.GET)
    public PageVO queryDictItem(
            @RequestParam("get") Object vo,
            @PathVariable("pageSize") Integer pageSize, @PathVariable("pageNo") Integer pageNo);


    /**
     * 根据用户名查询用户对象
     *
     * @param
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/account/find/{account}", method = RequestMethod.GET)
    public ResultVO findAccountBy(@PathVariable("account") String account);

    @ResponseBody
    @RequestMapping(value = "/account/query/{pageSize}/{pageNo}", method = RequestMethod.GET)
    public PageVO getAccountPage(
            @RequestParam("get") Object vo,
            @PathVariable("pageSize") Integer pageSize, @PathVariable("pageNo") Integer pageNo);
}
